package com.cy.store.Service;

import com.cy.store.Entity.Address;
import com.cy.store.Service.Ex.*;

import java.util.List;


public interface IAddressService {

    /**
     * 新增收货地址
     * @param uid 用户
     * @param username 用户名
     * @param address 地址数据
     */
    Integer addNewAddress(Integer uid,String username,Address address) throws AddressCountLimitException, InsertException;


    List<Address> getByUid(Integer uid);

    /**
     * 修改某个用户的某条收货地址数据为默认收货地址
     * @param aid 收货地址的id
     * @param uid 用户id
     * @param username 修改执行人
     */
    void setDefault(Integer aid,Integer uid,String username) throws AddressNotFoundException, AccessDeniedException, UpdateException;

    /**
     * 删除用户选中的收货地址数据
     * @param aid 收货地址id
     * @param uid 用户id
     * @param username 用户名
     */
    void delete(Integer aid,Integer uid,String username) throws AddressNotFoundException, AccessDeniedException, DeleteException, UpdateException;

    Address getByAid(Integer aid, Integer uid) throws AddressNotFoundException, AccessDeniedException;
}
